package lancooUpLoad;


import com.google.gson.Gson;

import testPaperWrong.jsonWrong.GetQuesParams;
import testPaperWrongHistory.jsonWrongHistory.WrongQuesParams;

/**
 * 数据打包组装
 * Created by Administrator on 2017/8/22/022.
 */

public class DataPackage {

    public  static Gson gson;


    /**
     * @组装单个试题保存数据
     * StuAnswer : C#$*#A
     * StuAssess : 正确#$*#错误
     * Duration : 100
     * CorrectRate : 0.2
     * AnsweredItemCount : 2
     * StuID : sa00000477
     * SubjectID : C
     * StageNo : B
     * QuesID : CBAE09073BHD80k00kh
     * State : 1
     * QuesFrom : 0
     * PaperID : 9EEE7517-1297-4442-B465-B4223790F735
     * QuesAns : {"StuAnswer":"C#$*#A","StuAssess":"正确#$*#错误","Duration":100,"CorrectRate":0.2,"AnsweredItemCount":2}
     */

    public static SaveDataJson getSaveDataJson(
             String StuID,
             String SubjectID,
             String StageNo,
             String QuesID,
             int State,
             double Score,
             String IsAssess,
             String QuesBrief,
             int TotalItemCount,
             int QuesFrom,
             String TypeID,
             String ImportantZSDCode,
             String MainZSDCode,
             String ImportantZSD,
             String MainZSD,
             int Difficulty,
             double TestProbablity,
             String StuName,
             String PaperID,
             String StuAnswer,
             String StuAssess,
             int Duration,
             double CorrectRate,
             int AnsweredItemCount,
             String PrimitiveQuesID){

        SaveDataJson mSaveDataJson = new SaveDataJson();
        mSaveDataJson.setStuID(StuID);
        mSaveDataJson.setSubjectID(SubjectID);
        mSaveDataJson.setStageNo(StageNo);
        mSaveDataJson.setQuesID(QuesID);
        mSaveDataJson.setState(State);
        mSaveDataJson.setScore(Score);
        mSaveDataJson.setIsAssess(IsAssess);
        mSaveDataJson.setQuesBrief(QuesBrief);
        mSaveDataJson.setTotalItemCount(TotalItemCount);
        mSaveDataJson.setQuesFrom(QuesFrom);
        mSaveDataJson.setTypeID(TypeID);
        mSaveDataJson.setImportantZSDCode(ImportantZSDCode);
        mSaveDataJson.setMainZSDCode(MainZSDCode);
        mSaveDataJson.setImportantZSD(ImportantZSD);
        mSaveDataJson.setMainZSD(MainZSD);
        mSaveDataJson.setDifficulty(Difficulty);
        mSaveDataJson.setTestProbablity(TestProbablity);
        mSaveDataJson.setStuName(StuName);
        mSaveDataJson.setPaperID(PaperID);
        mSaveDataJson.setStuAnswer(StuAnswer);
        mSaveDataJson.setStuAssess(StuAssess);
        mSaveDataJson.setDuration(Duration);
        mSaveDataJson.setCorrectRate(CorrectRate);
        mSaveDataJson.setAnsweredItemCount(AnsweredItemCount);
        mSaveDataJson.setPrimitiveQuesID(PrimitiveQuesID);

        gson = new Gson();
        return mSaveDataJson;
    }

    /**
     * @组装整份试卷提交数据
     * QuesID : CBAE07058BHA103005r
     * StuAnswer : zhangqinglei
     * StuAssess : zhangqinglei
     * Duration : 30
     * CorrectRate : 0.5
     * AnsweredItemCount : 5
     * StuID : sa00000477
     * SubjectID : C
     * StageNo : B
     * QuesFrom : 0
     * PaperID : 5FAB5C35-2182-42e4-AF27-0C551F3BC235
     * CurrentStuAnsTree : {"QuesID":"CBAE07058BHA103005r","StuAnswer":"zhangqinglei","StuAssess":"zhangqinglei","Duration":30,"CorrectRate":0.5,"AnsweredItemCount":5}
     */
    public static SubmitDataJson getSubmitDataJson(
            String StuID,
            String SubjectID,
            String StageNo,
            String QuesID,
            int State,
            double Score,
            String IsAssess,
            String QuesBrief,
            int TotalItemCount,
            int QuesFrom,
            String TypeID,
            String ImportantZSDCode,
            String MainZSDCode,
            String ImportantZSD,
            String MainZSD,
            int Difficulty,
            double TestProbablity,
            String StuName,
            String PaperID,
            String StuAnswer,
            String StuAssess,
            int Duration,
            double CorrectRate,
            int AnsweredItemCount,
            String PrimitiveQuesID){

        SubmitDataJson mSubmitDataJson= new SubmitDataJson();
        mSubmitDataJson.setStuID(StuID);
        mSubmitDataJson.setSubjectID(SubjectID);
        mSubmitDataJson.setStageNo(StageNo);
        mSubmitDataJson.setQuesID(QuesID);
        mSubmitDataJson.setState(State);
        mSubmitDataJson.setScore(Score);
        mSubmitDataJson.setIsAssess(IsAssess);
        mSubmitDataJson.setQuesBrief(QuesBrief);
        mSubmitDataJson.setTotalItemCount(TotalItemCount);
        mSubmitDataJson.setQuesFrom(QuesFrom);
        mSubmitDataJson.setTypeID(TypeID);
        mSubmitDataJson.setImportantZSDCode(ImportantZSDCode);
        mSubmitDataJson.setMainZSDCode(MainZSDCode);
        mSubmitDataJson.setImportantZSD(ImportantZSD);
        mSubmitDataJson.setMainZSD(MainZSD);
        mSubmitDataJson.setDifficulty(Difficulty);
        mSubmitDataJson.setTestProbablity(TestProbablity);
        mSubmitDataJson.setStuName(StuName);
        mSubmitDataJson.setPaperID(PaperID);
        mSubmitDataJson.setStuAnswer(StuAnswer);
        mSubmitDataJson.setStuAssess(StuAssess);
        mSubmitDataJson.setDuration(Duration);
        mSubmitDataJson.setCorrectRate(CorrectRate);
        mSubmitDataJson.setAnsweredItemCount(AnsweredItemCount);
        mSubmitDataJson.setPrimitiveQuesID(PrimitiveQuesID);

        gson = new Gson();
        return mSubmitDataJson;
    }


    /*
    * 组装基本复习错题请求结构数据
     * StuID : sa00000477
     * SubjectID : C
     * StageNo : B
     * QuesFrom : 0
     * QuesID : CBAE11085BHE8050072|CBAE11080BHE805008v|CBAE11085BHE807006H
     */
    public static GetQuesParams getQuesParams(String StuID,
                                                     String SubjectID,
                                                     String StageNo,
                                                     int QuesFrom,
                                                     String QuesID){

        GetQuesParams mGetQuesParams =  new GetQuesParams();
        mGetQuesParams.setStuID(StuID);
        mGetQuesParams.setSubjectID(SubjectID);
        mGetQuesParams.setStageNo(StageNo);
        mGetQuesParams.setQuesFrom(QuesFrom);
        mGetQuesParams.setQuesID(QuesID);
        gson = new Gson();
        return mGetQuesParams;
    }


    /*
    * 组装知识点保存请求数据结构模板
     * StuID : sa00000477
     * SubjectID : C
     * StageNo : B
     * StuName : 赵晓兰
     * ZSDName : 123
     * ZSDCode : CE11085000000B0AA
     */
    public static SaveLearnedZSD saveLearnedZSD(     String StuID,
                                                       String SubjectID,
                                                       String StageNo,
                                                       String StuName,
                                                       String ZSDName,
                                                       String ZSDCode){

        SaveLearnedZSD mSaveLearnedZSD =  new SaveLearnedZSD();
        mSaveLearnedZSD.setStuID(StuID);
        mSaveLearnedZSD.setSubjectID(SubjectID);
        mSaveLearnedZSD.setStageNo(StageNo);
        mSaveLearnedZSD.setStuName(StuName);
        mSaveLearnedZSD.setZSDName(ZSDName);
        mSaveLearnedZSD.setZSDCode(ZSDCode);
        gson = new Gson();
        return mSaveLearnedZSD;
    }


    /**
     * @组装错题单个试题保存数据
     * StuAnswer : C#$*#A
     * StuAssess : 正确#$*#错误
     * Duration : 100
     * CorrectRate : 0.2
     * AnsweredItemCount : 2
     * StuID : sa00000477
     * SubjectID : C
     * StageNo : B
     * QuesID : CBAE09073BHD80k00kh
     * State : 1
     * QuesFrom : 0
     * PaperID : 9EEE7517-1297-4442-B465-B4223790F735
     * QuesAns : {"StuAnswer":"C#$*#A","StuAssess":"正确#$*#错误","Duration":100,"CorrectRate":0.2,"AnsweredItemCount":2}
     * PrimitiveQuesID : CBAE10077BHE804007P
     * PrimQuesItemCount : 13
     */

    public static SaveDataWrongJson getSaveDataWrongJson(
            String StuID,
            String SubjectID,
            String StageNo,
            String QuesID,
            int State,
            double Score,
            String IsAssess,
            String QuesBrief,
            int TotalItemCount,
            int QuesFrom,
            String TypeID,
            String ImportantZSDCode,
            String MainZSDCode,
            String ImportantZSD,
            String MainZSD,
            int Difficulty,
            double TestProbablity,
            String StuName,
            String PaperID,
            String StuAnswer,
            String StuAssess,
            int Duration,
            double CorrectRate,
            int AnsweredItemCount,
            String PrimitiveQuesID,
            int PrimQuesItemCount){

        SaveDataWrongJson mSaveDataWrongJson = new SaveDataWrongJson();
        mSaveDataWrongJson.setStuID(StuID);
        mSaveDataWrongJson.setSubjectID(SubjectID);
        mSaveDataWrongJson.setStageNo(StageNo);
        mSaveDataWrongJson.setQuesID(QuesID);
        mSaveDataWrongJson.setState(State);
        mSaveDataWrongJson.setScore(Score);
        mSaveDataWrongJson.setIsAssess(IsAssess);
        mSaveDataWrongJson.setQuesBrief(QuesBrief);
        mSaveDataWrongJson.setTotalItemCount(TotalItemCount);
        mSaveDataWrongJson.setQuesFrom(QuesFrom);
        mSaveDataWrongJson.setTypeID(TypeID);
        mSaveDataWrongJson.setImportantZSDCode(ImportantZSDCode);
        mSaveDataWrongJson.setMainZSDCode(MainZSDCode);
        mSaveDataWrongJson.setImportantZSD(ImportantZSD);
        mSaveDataWrongJson.setMainZSD(MainZSD);
        mSaveDataWrongJson.setDifficulty(Difficulty);
        mSaveDataWrongJson.setTestProbablity(TestProbablity);
        mSaveDataWrongJson.setStuName(StuName);
        mSaveDataWrongJson.setPaperID(PaperID);
        mSaveDataWrongJson.setStuAnswer(StuAnswer);
        mSaveDataWrongJson.setStuAssess(StuAssess);
        mSaveDataWrongJson.setDuration(Duration);
        mSaveDataWrongJson.setCorrectRate(CorrectRate);
        mSaveDataWrongJson.setAnsweredItemCount(AnsweredItemCount);
        mSaveDataWrongJson.setPrimitiveQuesID(PrimitiveQuesID);
        mSaveDataWrongJson.setPrimQuesItemCount(PrimQuesItemCount);

        gson = new Gson();
        return mSaveDataWrongJson;
    }

    /*
    *组装错题原题信息
     * StuID : sa00000477
     * SubjectID : C
     * StageNo : B
     * QuesID : CBAE11085BHE8050072
     * QuesFrom : 0
     * TotalItemCount : 1
    *
    * */
    public static SaveLearnedWrongQues getSaveLearnedWrongQuesJson(
             String StuID,
             String SubjectID,
             String StageNo,
             String QuesID,
             int QuesFrom,
             int TotalItemCount){

        SaveLearnedWrongQues mSaveLearnedWrongQues = new SaveLearnedWrongQues();
        mSaveLearnedWrongQues.setStuID(StuID);
        mSaveLearnedWrongQues.setSubjectID(SubjectID);
        mSaveLearnedWrongQues.setStageNo(StageNo);
        mSaveLearnedWrongQues.setQuesID(QuesID);
        mSaveLearnedWrongQues.setQuesFrom(QuesFrom);
        mSaveLearnedWrongQues.setTotalItemCount(TotalItemCount);

        gson = new Gson();
        return mSaveLearnedWrongQues;
    }

    /**
     * @组装错题整份试卷提交数据
     * QuesID : CBAE07058BHA103005r
     * StuAnswer : zhangqinglei
     * StuAssess : zhangqinglei
     * Duration : 30
     * CorrectRate : 0.5
     * AnsweredItemCount : 5
     * StuID : sa00000477
     * SubjectID : C
     * StageNo : B
     * QuesFrom : 0
     * PaperID : 5FAB5C35-2182-42e4-AF27-0C551F3BC235
     * CurrentStuAnsTree : {"QuesID":"CBAE07058BHA103005r","StuAnswer":"zhangqinglei","StuAssess":"zhangqinglei","Duration":30,"CorrectRate":0.5,"AnsweredItemCount":5}
     *
     *
     */
    public static SubmitDataWrongJson getSubmitDataWrongJson(
            String StuID,
            String SubjectID,
            String StageNo,
            String QuesID,
            int State,
            double Score,
            String IsAssess,
            String QuesBrief,
            int TotalItemCount,
            int QuesFrom,
            String TypeID,
            String ImportantZSDCode,
            String MainZSDCode,
            String ImportantZSD,
            String MainZSD,
            int Difficulty,
            double TestProbablity,
            String StuName,
            String PaperID,
            String StuAnswer,
            String StuAssess,
            int Duration,
            double CorrectRate,
            int AnsweredItemCount,
            String PrimitiveQuesID,
            int PrimQuesItemCount){

        SubmitDataWrongJson mSubmitDataWrongJson= new SubmitDataWrongJson();
        mSubmitDataWrongJson.setStuID(StuID);
        mSubmitDataWrongJson.setSubjectID(SubjectID);
        mSubmitDataWrongJson.setStageNo(StageNo);
        mSubmitDataWrongJson.setQuesID(QuesID);
        mSubmitDataWrongJson.setState(State);
        mSubmitDataWrongJson.setScore(Score);
        mSubmitDataWrongJson.setIsAssess(IsAssess);
        mSubmitDataWrongJson.setQuesBrief(QuesBrief);
        mSubmitDataWrongJson.setTotalItemCount(TotalItemCount);
        mSubmitDataWrongJson.setQuesFrom(QuesFrom);
        mSubmitDataWrongJson.setTypeID(TypeID);
        mSubmitDataWrongJson.setImportantZSDCode(ImportantZSDCode);
        mSubmitDataWrongJson.setMainZSDCode(MainZSDCode);
        mSubmitDataWrongJson.setImportantZSD(ImportantZSD);
        mSubmitDataWrongJson.setMainZSD(MainZSD);
        mSubmitDataWrongJson.setDifficulty(Difficulty);
        mSubmitDataWrongJson.setTestProbablity(TestProbablity);
        mSubmitDataWrongJson.setStuName(StuName);
        mSubmitDataWrongJson.setPaperID(PaperID);
        mSubmitDataWrongJson.setStuAnswer(StuAnswer);
        mSubmitDataWrongJson.setStuAssess(StuAssess);
        mSubmitDataWrongJson.setDuration(Duration);
        mSubmitDataWrongJson.setCorrectRate(CorrectRate);
        mSubmitDataWrongJson.setAnsweredItemCount(AnsweredItemCount);
        mSubmitDataWrongJson.setPrimitiveQuesID(PrimitiveQuesID);
        mSubmitDataWrongJson.setPrimQuesItemCount(PrimQuesItemCount);

        gson = new Gson();
        return mSubmitDataWrongJson;
    }

    /*
    * 组装历史推荐题错题请求结构数据
     * StuID : sa00000477
     * SubjectID : C
     * StageNo : B
     * QuesFrom : 0
     * QuesID : CBAE11085BHE8050072
     */
    public static WrongQuesParams GetWrongQuesParams(String StuID,
                                                  String SubjectID,
                                                  String StageNo,
                                                  int QuesFrom,
                                                  String QuesID){

        WrongQuesParams mWrongQuesParams =  new WrongQuesParams();
        mWrongQuesParams.setStuID(StuID);
        mWrongQuesParams.setSubjectID(SubjectID);
        mWrongQuesParams.setStageNo(StageNo);
        mWrongQuesParams.setQuesFrom(QuesFrom);
        mWrongQuesParams.setQuesID(QuesID);
        gson = new Gson();
        return mWrongQuesParams;
    }

    /*
    * 组装更改试题收藏信息的数据结构
     * StuID : sa00000480
     * SubjectID : C
     * StageNo : B
     * QuesBrief : 现在有许多新的购物方式，网上购物是其中的一种。越来越多的人熟悉和喜欢网购。但是网购有利有弊。请根据下面提供的信息用英语以Online shopping为题写一篇短文，描述网购的优点和缺点，并谈谈自己的看法。<BR>优点：<BR>1.可以在任何时间购物。<BR>2.只需要一台电脑和鼠标。<BR>3.方便比较同类产品的价格，可以省钱。<BR>4.无论何时何地都可以收到所购物品。<BR>... ...<BR>缺点：<BR>1.网上付款有时不安全。<BR>2.看不到实物，也不能试穿衣服。<BR>... ...<BR>1.不得在作文中出现你真实的学校名称和自己的姓名。<BR>2.语句连贯，表达准确，词数80-100。<BR>3.短文开头已给出，不计人总词数。<BR>Online shopping<BR>There are many new ways of shopping, and online shopping is one of them.<BR><BR>__________________________________________________
     * QuesID : CBAE07061BHf10R00Ns
     * TypeID : f
     * IsLike : 1
    * */
    public static ChangeStuFavouriteModel GetChangeStuFavouriteModel( String StuID,
             String SubjectID,
             String StageNo,
             String QuesBrief,
             String QuesID,
             String TypeID,
             int IsLike){

        ChangeStuFavouriteModel mChangeStuFavouriteModel =  new ChangeStuFavouriteModel();
        mChangeStuFavouriteModel.setStuID(StuID);
        mChangeStuFavouriteModel.setSubjectID(SubjectID);
        mChangeStuFavouriteModel.setStageNo(StageNo);
        mChangeStuFavouriteModel.setQuesBrief(QuesBrief);
        mChangeStuFavouriteModel.setQuesID(QuesID);
        mChangeStuFavouriteModel.setTypeID(TypeID);
        mChangeStuFavouriteModel.setIsLike(IsLike);
        gson = new Gson();
        return mChangeStuFavouriteModel;
    }


}
